-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow removing a pointer from a field #7518
feat: allow removing a pointer from a field #7518
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7518 +/- ##
==========================================
- Coverage 93.97% 93.92% -0.06%
==========================================
Files 181 181
Lines 13354 13275 -79
==========================================
- Hits 12550 12468 -82
- Misses 804 807 +3
Continue to review full report at Codecov.
|
Thanks for this PR! Please make sure to check the "I'm not disclosing a vulnerability" box in the template and keep in mind that if you encounter any vulnerability to not discuss or include it as part of this PR. |
Will do, I also plan on updating the documentation, I just ran out of time yesterday. I will add it in today. |
Great! Let us know if you need any guidance. |
I checked in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use op delete
@cjbland could you take a look at this PR? it would be great if we could get this ready for merge. |
The label |
Just pushed some changes, let me know if that's what you're looking for. |
Thanks for opening this pull request!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@cjbland could you look at the failing tests? |
Yes, sure thing; give me a couple of days to circle back to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cjbland @mtrezza here i think we have a deeper issue on the whole GraphQL API. My team also start to encounter many issues with the current implementation of aField: null
on the the GraphQL API.
I think we need here to convert on the graphql layer all null
to {__op: "Delete"}
, since null
in the database will not resolve on {aField: { exists: false}}
.
We have the same null
handling issue, on File
, Pointer
and all other field. Currently developers using the GraphQL API do not have any solution (without cloud code) to completly unset
a filed from the Parse Object.
I'll push a PR that convert all null
value on mutation to {__op: "Delete"}
Also the null to opDelete
implementation will be easier for developers to use and will avoid new interfaces like unlink
on File
. Pointer
and all other fields.
PS: Currently my team need to write some cloud code functions to correctly convert null
to undefined
, via request.object.unset("aField")
, it looks like tedious, hard to maintain and expose the developer to weird bugs if some fields are not checked in the cloud function.
@mtrezza based on my comment #7518 (review) I'll suggest to close this PR and i'll push a global fix for the whole graphqh API. Issue: #7648 |
Looking at the GraphQL spec it seems you are correct. |
New Pull Request Checklist
Issue Description
Creates a new field on the pointer type to allow removing (unlink) an object from a pointer field.
Related issue: #7517
Approach
TODOs before merging
Add security check